package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	FeeHouseOrderEventNew           = "pm.FeeHouseOrderNew"
	FeeHouseOrderEventBeforeCreate  = "pm.FeeHouseOrderBeforeCreate"
	FeeHouseOrderEventBeforeUpdate  = "pm.FeeHouseOrderBeforeUpdate"
	FeeHouseOrderEventBeforeSave    = "pm.FeeHouseOrderBeforeCreate pm.FeeHouseOrderBeforeUpdate"
	FeeHouseOrderEventAfterCreate   = "pm.FeeHouseOrderAfterCreate"
	FeeHouseOrderEventAfterUpdate   = "pm.FeeHouseOrderAfterUpdate"
	FeeHouseOrderEventAfterSave     = "pm.FeeHouseOrderAfterCreate pm.FeeHouseOrderAfterUpdate"
	FeeHouseOrderEventDelete        = "pm.FeeHouseOrderDelete"
	FeeHouseOrderAccessControlEvent = "pm.FeeHouseOrderAccessControl"
)

func GetFeeHouseOrderConfig() *mgo.DocConfig {
	return FeeHouseOrder_Config
}

var FeeHouseOrder_Config *mgo.DocConfig

func init() {
	FeeHouseOrder_Config = NewFeeHouseOrderConfig()
}
func NewFeeHouseOrderConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "pm.FeeHouseOrder",
		Fields: []string{
			"sn", "payType", "amount", "cut", "note", "state", "bills",
		},
		RelationFields: []string{
			"payType", "bills",
		},
		RelationConfigs: map[string]*mgo.DocRelation{
			"payType": {
				Config:     GetPayTypeConfig,
				DocName:    "PayType",
				JoinType:   "O",
				KeyInside:  "payTypeId",
				KeyOutSide: "id",
			},
			"bills": {
				Config:     GetFeeHouseConfig,
				DocName:    "FeeHouse",
				JoinType:   "M",
				KeyInside:  "id",
				KeyOutSide: "orderId",
			},
		},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
